package sha256

import (
	"ac-common-go/common"
	"strings"
	log "ac-common-go/glog"
)

func CheckSha256(_encryptstr, _sha256str string) (ret bool) {
	//方法一
	sha256str1 := common.SHA256([]byte(_encryptstr))
	cmpstr := sha256str1
	log.Info("CHECK sha256[%s]", cmpstr)
	if strings.Compare(cmpstr, _sha256str) == 0 {
		ret = true
	} else {
		ret = false
	}
	return ret
}
func Sha256Encode(_encryptstr string) (_encoderet string, err error) {
	sha256str1 := common.SHA256([]byte(_encryptstr))
	_encoderet = sha256str1
	return _encoderet, nil
}